<?php
namespace app\home\controller;
use think\Controller;
use app\home\model\GoodscatsModel;

class Goodscats extends Controller{

    public function goodsCatsList(){

        $GoodsCats=new GoodscatsModel();
        $rows = $GoodsCats->getGoodsCats();

        $this->assign('rows',$rows);
        return $this->fetch('goods_cats_list');
    }
    //要搜索的商品
    public function searchGoods(){
        $goods_name=input('goods_name');
        if( trim($goods_name)==''  ){
            $this->redirect('Goodscats/goodsCatsList');
            return;
        }
        $GoodsCats=new GoodscatsModel();
        $rows = $GoodsCats->searchGoods($goods_name);

        $this->assign('rows',$rows);
        return $this->fetch('search_goods');
    }

}